﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

using Software41.Tracking.BAM;
using Software41.Tracking.BAM.Adapters;
using Microsoft.BizTalk.Bam.EventObservation;

namespace Software41.TrackingExample.TestService
{
    [ServiceBehavior(Namespace = "http://Software41.TrackingExample.TestService")]
    public class TestService : ITestService
    {
        public TestResponse DoWork(TestRequest message)
        {
            var response = new TestResponse();
            //assign the process id for tracking purposes
            response.ProcessId = message.ProcessId;

            try
            {
                response.Status = this.DoMoreWork();
                response.Message = "Finished working.";
                response.Success = true;
            }
            catch (Exception ex)
            {
                response.Status = "CompletedError";
                response.Message = "Exception: " + ex.Message;
                response.Success = false;
            }
            return response;
        }

        #region Private Methods
        private string DoMoreWork()
        {
            return "CompletedWcfOperation";
        }
        #endregion
    }
}
